package com.mapapp.flutter_mapapp.adapter;

import android.support.annotation.NonNull;
import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.mapapp.flutter_mapapp.R;

public class AddPictureAdapter extends BaseQuickAdapter<String, BaseViewHolder> {

    private boolean showDel = true;

    public void makeDelGone() {
        showDel = false;
        notifyDataSetChanged();
    }

    public AddPictureAdapter(int layoutResId) {
        super(layoutResId);
    }

    @Override
    protected void convert(@NonNull BaseViewHolder helper, String item) {
        Glide.with(mContext).load(item).into((ImageView) helper.getView(R.id.image));
        helper.addOnClickListener(R.id.iv_delete);
        helper.setGone(R.id.iv_delete, showDel);
    }
}
